function constraints=computeConstraintValues(OP, lowerLimit, upperLimit)
constraints = zeros(2, 2);

lowerTerm = (lowerLimit - OP) * -1;
upperTerm = upperLimit - OP;

if (lowerTerm > 0)
    constraints(1, 1) = -1 / abs(lowerTerm);
    constraints(1, 2) = -1;
elseif (lowerTerm < 0)
    constraints(1, 1) = -1 / abs(lowerTerm);
    constraints(1, 2) = 1;
else
    constraints(1, 1) = -1;
    constraints(1, 2) = 0;
end

if (upperTerm > 0)
    constraints(2, 1) = 1 / abs(upperTerm);
    constraints(2, 2) = -1;
elseif (upperTerm < 0)
    constraints(2, 1) = 1 / abs(upperTerm);
    constraints(2, 2) = 1;
else
    constraints(2, 1) = 1;
    constraints(2, 2) = 0;
end
end